<template>
	<view class="content">
		<view class="match-top-box">
			<view class="match-title">尊敬的委托人：</view>
			<view class="match-txt">您好！您的法律服务已经免费取消，如您需要其他法律服务，请点击以下按钮下单。感谢您的信任与支持！祝您生活愉快，身体健康。</view>
			<view class="match-txt" v-if="info.order.money_type != '先用后付 无忧付' && info.order.price_type != '投资人支付(不用还)'">退款将返回您的账户，预计1-7个工作日到账，请注意查收。</view>
			<law-nav></law-nav>
		</view>
		<!-- 收款详情 -->
		 <order-client-cancel v-if="Object.keys(info.order.jie_pay).length > 0" :detailLIst="info.order.pay_text" title="收款详情" :info="info"  @popupShow="popupShow"></order-client-cancel>
		<!-- 订单详情 -->
		<order-detail ref="orderAllDetail" :info="info.order" :isCloseOrder=" isCloseOrder"></order-detail>
		<!-- 全局通用组件 -->
		<law-common ref="lawCommon"></law-common>
		<lawyer-qing6 ref="lawyerQing6" :item="current_item"></lawyer-qing6>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {
					order: {}
				},
				order_id: '',
				isCloseOrder:true,
				current_item:{}
			};
		},
		onBackPress(e) {
			if (e.from == 'backbutton') {
				this.$Router.replace('/pages/client/user/order')
				// this.$Router.back(2);
				return true;
			}
		},
		onLoad(params) {
			if (params.order_id) {
				this.order_id = params.order_id;
				this.init();
			}
		},
		onShow(){
			if(this.order_id){
				console.log("================this.info ,",this.order_id);
				this.init();
			}
		},
		methods: {
			async init() {
				let formData = {
					id: this.order_id,
					token: uni.getStorageSync('token')
				};
				let res = await this.$api('index.orderDetail', formData);
				this.info = res.data;
			},
			popupShow(item) {
				console.log(item.type,'----item.type')
				console.log('000item',item)
				if (item.type == 8) {
					this.current_item = item
					this.$refs.returnCostTip.$refs.returnCost.open()
				} else if (item.type == 3 || item.type == 1) {
					/* this.current_item = item.popup
					this.$refs.settlement.$refs.settlement.open() */
					// this.current_item = item
					// this.$refs.investShouyi.$refs.investShou.open()
					this.current_item = item
					this.$refs.investShouyi.$refs.investShou.open()
				} else if (item.type == 7) {
					this.current_item = item.popup
					this.$refs.lawyerApply.$refs.lawyerApply.open()
				} else if (item.type == 2) {
					// 退款弹窗
					this.current_item = item.popup
					this.$refs.lawyerTui.$refs.lawyerApply.open();
				}else if(item.fen == 12){
					console.log('XXXdddddddddd');
					this.current_item = item.popup;
					this.$refs.lawyerQing6.$refs.lawyerApply6.open()
				}
			},
		},
	};
</script>

<style lang="scss">
	.content {
		padding-bottom: 30rpx;
	}

	.nav-list {
		margin: 0 -30rpx;
	}
</style>
